home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 September / Ahoy_Magazine_86-09_1986_Double_L.d64 / Large Product (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  422b  |  19 lines

  1. 0 poke 53280,15:poke53281,15:print"please wait..."
  2. 1 rem commodares problem #29-4:
  3. 2 rem   large product
  4. 3 rem solution by
  5. 4 rem   bob brown
  6. 5 rem
  7. 110 forj=1to4:p(j)=j:next:gosub3000
  8. 200 fork=4to1step-1:ifp(k)<5+kthengosub2000:goto200
  9. 220 next
  10. 1000 printb,val(c$),val(d$):stop
  11. 2000 p(k)=p(k)+1:ifk=4 then 3000
  12. 2010 forl=k+1toj:p(l)=p(l-1)+1:next
  13. 3000 a$="":b$="":c=1:forl=1to9
  14. 3020 ifp(c)=lthena$=a$+str$(10-l):c=c+1:goto3050
  15. 3030 b$=b$+str$(10-l)
  16. 3050 next
  17. 3100 p=val(a$)*val(b$):ifp>bthenb=p:c$=a$:d$=b$
  18. 3200 return
  19.